package com.yuneec.fly.utils;

import java.io.File;
import java.io.FileInputStream;

/**
 * Created by gjw on 2017/3/29.
 */

public class FileUtils {

    public static byte[] readFile(File file) {
        byte[] fileData = null;
        if (file != null) {
            try {
                fileData = new byte[(int) file.length()];
                FileInputStream fis = new FileInputStream(file);
                fis.read(fileData);
            } catch (Exception e) {
                fileData = null;
                e.printStackTrace();
            }
        }
        return fileData;
    }
}
